﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UI/Site.Master" AutoEventWireup="true" CodeBehind="SaveProductInStore.aspx.cs" Inherits="SalesAndStoreApp.UI.StoreManager.SaveProductInStore" %>
<%@ Register TagPrefix="ajaxToolkit" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit, Version=4.1.60501.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
   
    <div style="width: 668px; height: 23px;">
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;
                <br />
            </div>
    <div id="main_Div">
        <div id="Title_Div" class="style1">
            <strong>
            <br />
            Enter Product In Store</strong><br />
            <br />
        </div>
        <div id="product_store_div" class="divSubjectStyle">
            <div id="vendor_Date_InsertionDiv" class="divSubjectStyle"> Select Vendor and Date... <br/>   
                <asp:Label ID="Label5" runat="server" Text="Vendor:  "></asp:Label>
                <asp:DropDownList ID="vendorDropDown" runat="server" Width="201px">
                </asp:DropDownList>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<asp:Label ID="Label4" runat="server" Text="Date: "></asp:Label>
                 <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
                <asp:TextBox ID="dateTextBox" runat="server" Style="margin-left: 6px" 
                    Width="107px" BorderStyle="None"></asp:TextBox>
                    <ajaxToolkit:CalendarExtender ID="CalendarExtender1"
                        runat="server" TargetControlID="dateTextBox">
                    </ajaxToolkit:CalendarExtender>
                <br />
                <br />
            </div>
            <br/>
            <div class="divSubjectStyle" id = "product_stand_div" runat="server">
            <div id="product_Item_Insertion_Div" class="divStyle" >
                <asp:Label ID="Label1" runat="server" Text="Product/Item:  "></asp:Label>
                <asp:DropDownList ID="productDropDownList" runat="server" AutoPostBack="True" 
                    onselectedindexchanged="productDropDownList_SelectedIndexChanged">
                </asp:DropDownList>
                &nbsp;&nbsp;&nbsp;<asp:Label ID="Label2" runat="server" Text="Qty:  "></asp:Label>
                &nbsp;
                <asp:TextBox ID="quantityTextBox" runat="server" Width="44px"></asp:TextBox>
                <br />
                <br />
                <asp:Label ID="Label3" runat="server" Text="UnitPrice: "></asp:Label>
                <asp:Label ID="unitPriceLabel" runat="server" Text=""></asp:Label>
            </div>
            <div id="add_action_div" class="divStyle" >
                
                <asp:Button ID="addButton" runat="server" Text="+ Add" Style="margin-left: 417px"
                    OnClick="addButton_Click" Width="93px" BackColor="#006600" 
                    ForeColor="White" />
                <br />
            </div>
            </div>
            <br/>
            <div id="details_list_div" class="divStyle"> The Added Products... <br/>
                <asp:ListView ID="productStoreListView" runat="server" DataSourceID="ObjectDataSource1"
                    Style="margin-right: 0px">
                    <LayoutTemplate>
                        <table id="Table1" runat="server">
                            <tr id="Tr1" runat="server">
                                <td id="Td1" runat="server">
                                    <table id="itemPlaceholderContainer" runat="server" border="1" style="background-color: #FFFFFF;
                                        border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px;
                                        font-family: Verdana, Arial, Helvetica, sans-serif;">
                                        <tr id="Tr2" runat="server" style="background-color: #DCDCDC; color: #000000;">
                                            <th id="Th1" runat="server" hidden="true">
                                                Id
                                            </th>
                                            <th id="Th2" runat="server">
                                                Name
                                            </th>
                                            <th id="Th3" runat="server">
                                                Unit Price
                                            </th>
                                            <th id="Th4" runat="server">
                                                Quantity
                                            </th>
                                        </tr>
                                        <tr id="itemPlaceholder" runat="server">
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr id="Tr3" runat="server">
                                <td id="Td2" runat="server" style="text-align: center; background-color: #CCCCCC;
                                    font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000;">
                                    <asp:DataPager ID="DataPager1" runat="server">
                                        <Fields>
                                            <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" />
                                        </Fields>
                                    </asp:DataPager>
                                </td>
                            </tr>
                        </table>
                    </LayoutTemplate>
                    <AlternatingItemTemplate>
                        <tr style="background-color: #FFF8DC;">
                            <td hidden="true">
                                <asp:Label ID="idLabel" runat="server" Text='<%# Eval("Id") %>' />
                            </td>
                            <td>
                                <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("Name") %>' />
                            </td>
                            <td>
                                <asp:Label ID="unitPriceLabel" runat="server" Text='<%# Eval("BuyUnitPrice") %>' />
                            </td>
                            <td>
                                <asp:Label ID="quantityLabel" runat="server" Text='<%# Eval("Inventory.Quantity") %>' />
                            </td>
                        </tr>
                    </AlternatingItemTemplate>
                    <EmptyDataTemplate>
                        <table id="Table2" runat="server" style="background-color: #FFFFFF; border-collapse: collapse;
                            border-color: #999999; border-style: none; border-width: 1px;">
                            <tr>
                                <td style="color: red">
                                    No Product is Added.
                                </td>
                            </tr>
                        </table>
                    </EmptyDataTemplate>
                    <ItemTemplate>
                        <tr style="background-color: #DCDCDC; color: #000000;">
                            <td hidden="true">
                                <asp:Label ID="idLabel" runat="server" Text='<%# Eval("Id") %>' Visible="False" />
                            </td>
                            <td>
                                <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("Name") %>' />
                            </td>
                            <td>
                                <asp:Label ID="unitPriceLabel" runat="server" Text='<%# Eval("BuyUnitPrice") %>' />
                            </td>
                            <td>
                                <asp:Label ID="quantityLabel" runat="server" Text='<%# Eval("Inventory.Quantity") %>' />
                            </td>
                        </tr>
                    </ItemTemplate>
                    <SelectedItemTemplate>
                        <tr style="background-color: #008A8C; font-weight: bold; color: #FFFFFF;">
                            <td hidden="true">
                                <asp:Label ID="idLabel" runat="server" Text='<%# Eval("Id") %>' Visible="False" />
                            </td>
                            <td>
                                <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("Name") %>' />
                            </td>
                            <td>
                                <asp:Label ID="unitPriceLabel" runat="server" Text='<%# Eval("BuyUnitPrice") %>' />
                            </td>
                            <td>
                                <asp:Label ID="quantityLabel" runat="server" Text='<%# Eval("Inventory.Quantity") %>' />
                            </td>
                        </tr>
                    </SelectedItemTemplate>
                </asp:ListView>
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                    SelectMethod="GetAll" TypeName="SalesAndStoreApp.DAL.DAO.ViewProductsDAO">
                    <SelectParameters>
                        <asp:SessionParameter Name="products" SessionField="Products" Type="Object" />
                    </SelectParameters>
                </asp:ObjectDataSource>
                <br />
                <asp:Label ID="Label6" runat="server" Text="Total Price :"></asp:Label>
                <asp:Label ID="totalPriceLabel" runat="server"></asp:Label>
                <br />
                <br />
            </div>
           
            <div id="save_action_div">
                <asp:Button ID="saveButton" runat="server" Text="Save" 
                    Style="margin-left: 444px" BackColor="#006600" Font-Bold="False" 
                    ForeColor="White" Width="93px" onclick="saveButton_Click" />
                <br />
            </div>
            <div id="message_div">
                <asp:Label ID="messageLabel" runat="server" Text=""></asp:Label>
            </div>
        </div>
    </div>
</asp:Content>
